package com.fast.user.model.member;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import com.fast.base.db.model.Commnent;

/**
 * 用户浏览记录 指文章、公告、商品等
 * 
 * @author lushuifa
 *
 */
@Entity
@Table(name = "t_user_MemberVisitRecords")
@DynamicInsert(true)
@DynamicUpdate(true)
@Commnent("用户浏览记录")
public class MemberVisitRecords {

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "id", unique = true, nullable = false, length = 10)
	public int id = 0;
	// 唯一UUID
	public String uuid = "";
	@Column(name = "user_id", columnDefinition = ("varchar(64) comment '关联用户ID'"))
	private String userId = "";
	// 记录类型，如文章、公告、商品
	@Column(name = "record_Type", columnDefinition = ("varchar(64) comment '记录类型，如文章、公告、商品'"))
	private String recordType;
	@Column(name = "title", columnDefinition = ("varchar(32) comment '标题'"))
	private String title;
	@Column(name = "other_uuid", columnDefinition = ("varchar(64) comment '关联UUID'"))
	private String otherUUID;
	private String ip;

	// 操作信息
	@Commnent("编辑人ID")
	@Column(name = "editor_id", length = 11)
	public int editorId = 0;// 编辑人Id
	@Commnent("编辑人")
	@Column(name = "editor_name", length = 32)
	public String editorName = "";// 编辑人
	@Commnent("编辑时间")
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "edit_time")
	public Date editTime;// 编辑时间
	@Commnent("创建人ID")
	@Column(name = "creater_id", length = 11)
	public int createrId = 0;// 编辑人Id
	@Commnent("创建人")
	@Column(name = "creater", length = 32)
	public String creater = "";// 编辑人
	@Commnent("创建时间")
	@Column(name = "create_time", length = 32)
	@Temporal(TemporalType.TIMESTAMP)
	public Date createTime;
	@Commnent("删除标识")
	@Column(name = "delete_flag", length = 1)
	public int deleteFlag = 0;// 默认为不删除，1为删除

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getUuid() {
		return uuid;
	}

	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getRecordType() {
		return recordType;
	}

	public void setRecordType(String recordType) {
		this.recordType = recordType;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getOtherUUID() {
		return otherUUID;
	}

	public void setOtherUUID(String otherUUID) {
		this.otherUUID = otherUUID;
	}

	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public int getEditorId() {
		return editorId;
	}

	public void setEditorId(int editorId) {
		this.editorId = editorId;
	}

	public String getEditorName() {
		return editorName;
	}

	public void setEditorName(String editorName) {
		this.editorName = editorName;
	}

	public Date getEditTime() {
		return editTime;
	}

	public void setEditTime(Date editTime) {
		this.editTime = editTime;
	}

	public int getCreaterId() {
		return createrId;
	}

	public void setCreaterId(int createrId) {
		this.createrId = createrId;
	}

	public String getCreater() {
		return creater;
	}

	public void setCreater(String creater) {
		this.creater = creater;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public int getDeleteFlag() {
		return deleteFlag;
	}

	public void setDeleteFlag(int deleteFlag) {
		this.deleteFlag = deleteFlag;
	}

	@Override
	public String toString() {
		return "{\"id\":\"" + id + "\", \"uuid\":\"" + uuid + "\", \"userId\":\"" + userId + "\", \"recordType\":\""
				+ recordType + "\", \"title\":\"" + title + "\", \"otherUUID\":\"" + otherUUID + "\", \"ip\":\"" + ip
				+ "\", \"editorId\":\"" + editorId + "\", \"editorName\":\"" + editorName + "\", \"editTime\":\""
				+ editTime + "\", \"createrId\":\"" + createrId + "\", \"creater\":\"" + creater
				+ "\", \"createTime\":\"" + createTime + "\", \"deleteFlag\":\"" + deleteFlag + "\"}";
	}
}
